package com.ldzy.webase.controller;

import com.ldzy.webase.annotation.PassToken;
import com.ldzy.webase.entity.Consult;
import com.ldzy.webase.entity.Slideshow;
import com.ldzy.webase.exception.ExceptionResponse;
import com.ldzy.webase.exception.ExceptionResponseCode;
import com.ldzy.webase.service.ConsultService;
import com.ldzy.webase.utils.Response;
import com.ldzy.webase.utils.ResponseCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author ：Lq
 * @version ：1.0
 * @date ：2022/10/26 13:51
 * @description ：t_consult-咨询分类表-控制层
 */
@RestController
@ResponseBody
@RequestMapping("/consult")
public class ConsultController {
    @Autowired
    private ConsultService consultService;

    /**
     * @author ：Lq
     * @date ：2022/10/26 13:53
     * @description ：获取全部咨询分类
     */
    @GetMapping("/list")
    @PassToken
    public Response getConsultAll() {
        // 获取全部咨询分类
        List<Consult> consultAll = consultService.getConsultAll();

        // 将 数据 返回给前端
        return Response.build(ResponseCode.SUCCESS, consultAll);
    }
}
